import 'dart:ui';

class RectInfoModel {
  late final Rect rect;
  late final Path? path;
  late final CanvasEventType type;
  late final int? currentIndex;

  RectInfoModel({
    required this.rect,
    required this.type,
    this.currentIndex,
    this.path,
  });

  RectInfoModel.fromJson(Map<String, dynamic> json) {
    rect = json['rect'];
    type = json['type'];
    path = json['path'];
    currentIndex = json['currentIndex'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['rect'] = rect;
    data['type'] = type;
    data['path'] = path;
    data['currentIndex'] = currentIndex;
    return data;
  }
}

enum CanvasEventType { delete, rotate, scale, lock, image }
